import logging
from wcferry import WxMsg, Wcf
from modules.module_base import ModuleBase
from utils.gpt_util import GPTUtil


class ResponseGroupModule(ModuleBase):
    def __init__(self):
        super().__init__()
        self.log = logging.getLogger(__name__)
        self.open_ai = GPTUtil()

    def run(self, msg: WxMsg, wcf: Wcf):
        # 如果是文本消息，并且消息来自群消息，并且微信机器人被@了
        if msg.type == 1 and msg.from_group() and msg.is_at(wcf.get_self_wxid()):
            if "wxid" in msg.content:
                self.log.info(f"群roomid：{msg.roomid}")
                # wcf.send_text(f"{msg.roomid}", msg.roomid)
